import { getList } from "../../request/api"
const state = {
    list: []
}
const mutations = {
    changeList(state, res) {
        state.list = res;
    }
}
const actions = {
    listActions(context, keywords) {
        // 必须传一个对象
        let params = {
            keywords: keywords
        }
        getList(params).then(res => {
            if (res.code === 200) {
                context.commit("changeList", res.list)
            }
        })
    }
}
const getters = {
    list() {
        return state.list;
    }
}
export default {
    state,
    mutations,
    actions,
    getters,
    namespaced: true
}